#include <iostream>
using namespace std;
#include <vector>
#include <algorithm>

// 常用的排序算法  reverse
void MyPrint(int val)
{
    cout << val << " ";
}

void test1()
{
    vector<int>v;
    v.push_back(10);
    v.push_back(40);
    v.push_back(20);
    v.push_back(50);
    v.push_back(30);

    cout << "反转前：" << endl;
    
    for_each(v.begin(), v.end(), MyPrint);
    cout << endl;

    reverse(v.begin(), v.end());
    cout << "反转后：" << endl;
    
    for_each(v.begin(), v.end(), MyPrint);
    cout << endl;

}

int main()
{
    test1();
    return 0;
}